/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package extension.game.zone;

import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;
import extension.game.database.Database;

/**
 *
 * @author daz
 */
public class OnCountHandler extends BaseServerEventHandler {

    @Override
    public void handleServerEvent(ISFSEvent params) throws SFSException {
        GameZoneExtension ext = (GameZoneExtension) getParentExtension();
        Database database = ext.getDatabase();
        database.updateNumberPlayer(ext.getRoomPrefix(), ext.getParentZone().getUserCount());
    }
}
